home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / event / TreeSelectionEvent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.8 KB  |  67 lines

  1. package javax.swing.event;
  2.  
  3. import java.util.EventObject;
  4. import javax.swing.tree.TreePath;
  5.  
  6. public class TreeSelectionEvent extends EventObject {
  7.    protected TreePath[] paths;
  8.    protected boolean[] areNew;
  9.    protected TreePath oldLeadSelectionPath;
  10.    protected TreePath newLeadSelectionPath;
  11.  
  12.    public TreeSelectionEvent(Object var1, TreePath var2, boolean var3, TreePath var4, TreePath var5) {
  13.       super(var1);
  14.       this.paths = new TreePath[1];
  15.       this.paths[0] = var2;
  16.       this.areNew = new boolean[1];
  17.       this.areNew[0] = var3;
  18.       this.oldLeadSelectionPath = var4;
  19.       this.newLeadSelectionPath = var5;
  20.    }
  21.  
  22.    public TreeSelectionEvent(Object var1, TreePath[] var2, boolean[] var3, TreePath var4, TreePath var5) {
  23.       super(var1);
  24.       this.paths = var2;
  25.       this.areNew = var3;
  26.       this.oldLeadSelectionPath = var4;
  27.       this.newLeadSelectionPath = var5;
  28.    }
  29.  
  30.    public Object cloneWithSource(Object var1) {
  31.       return new TreeSelectionEvent(var1, this.paths, this.areNew, this.oldLeadSelectionPath, this.newLeadSelectionPath);
  32.    }
  33.  
  34.    public TreePath getNewLeadSelectionPath() {
  35.       return this.newLeadSelectionPath;
  36.    }
  37.  
  38.    public TreePath getOldLeadSelectionPath() {
  39.       return this.oldLeadSelectionPath;
  40.    }
  41.  
  42.    public TreePath getPath() {
  43.       return this.paths[0];
  44.    }
  45.  
  46.    public TreePath[] getPaths() {
  47.       int var1 = this.paths.length;
  48.       TreePath[] var2 = new TreePath[var1];
  49.       System.arraycopy(this.paths, 0, var2, 0, var1);
  50.       return var2;
  51.    }
  52.  
  53.    public boolean isAddedPath() {
  54.       return this.areNew[0];
  55.    }
  56.  
  57.    public boolean isAddedPath(TreePath var1) {
  58.       for(int var2 = this.paths.length - 1; var2 >= 0; --var2) {
  59.          if (this.paths[var2].equals(var1)) {
  60.             return this.areNew[var2];
  61.          }
  62.       }
  63.  
  64.       throw new IllegalArgumentException("path is not a path identified by the TreeSelectionEvent");
  65.    }
  66. }
  67.